Equal<X, Y>
code:ts
// prettier-ignore
type Equal<X, Y> =
(<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2)
? true
: false;
NotEqual<X, Y>
code:ts
type NotEqual<X, Y> = true extends Equal<X, Y> ? false : true
https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650